\documentclass[12pt]{article}
\usepackage{calc,fancyhdr}
\usepackage[hmargin=.5in,vmargin=.75in,
            footskip=.25in,headsep=.5in-\headheight]{geometry}

% Template solution to Exercise 5.

% Common formatting macros for CSC165.
\usepackage{amsmath,amssymb}
\input{macros-165}

% Page layout: stretch text to fill up page.
\flushbottom

% Headings.
\pagestyle{fancy}
\let\headrule\empty
\let\footrule\empty
\lhead{CSC\,165\,H1S}
\chead{Homework Exercise \#\,5}
\rhead{Winter 2014}

\begin{document}

\begin{large}
  \noindent
  Name: Robert Staskiewicz \hfill CDF login name: c3staski\\[0.5cm]
  Partner: Ekam Shahi    \hfill CDF login name: c3shahie
\end{large}

\medskip

\noindent
\rule{\textwidth}{.5pt}

\subsection*{Topic: Proofs I}

\medskip

\begin{enumerate}
 
       
    % place solution to question 1 below

    \item
    \medskip
    \noindent
    Consider the following claim:
    \begin{quote}
    The sum of two odd integers is an even integer.
    \end{quote}
    Let $ \mathbb O $ denote the set of odd integers. \\
    Let $ \mathbb E $ denote the set of even integers. \\
    We can express this in the notation of symbolic logic as:
    $$ \ \forall m,n \in \mathbb O,\ [m, n \implies (m + n) \in \mathbb E]  $$
    {\bf Proof:} \\
    \begin{pindent}
        Let $ \mathbb O $ denote the set of odd integers. \\
        Let $ \mathbb E $ denote the set of even integers. \\
        \begin{assumption}{$m,n \in \mathbb O$}
            Then $m=2q+1, n=2p+1,$ for some$\ p,q \in \Z$ \just{Definition of Odd Integer.}\\ 
            \begin{assumption}{$m+n$.}
                Then $m+n=2q+1+2p+1$
                    \just{Adding equations}\\
                Then $m+n=2q+2p+2$\\ 
                Then $m+n=2(q+p+1)$ \just{Factoring.}\\
                Let $q+p+1=r,\ r \in \Z$ \just{Closure,\ q and p are integers, so is q+p+1.}\\
                Then $m+n=2r$ \just{By Substitution.}\\
                Then $m+n$ is an even integer \just{Definition of an even integer.} \\
			Then $m,n \in \mathbb O \implies (m+n) \in \mathbb E$ \just{We assumed $m,n \in \mathbb O$ and derived $(m+n) \in \mathbb E$.}
            \end{assumption}
        \end{assumption}{Therefore, $ \ \forall m,n \in \mathbb O,\ [m, n \implies (m + n) \in \mathbb E]  $}
    \end{pindent}
    \medskip
    
    % place solution to question 2 below

    \item
    Consider the following claim:\\
    \begin{quote} 
    For all integers, if $n^2-2n+7$ is even, then $n$ is odd.\\
    \end{quote}
    Let $ \mathbb O $ denote the set of odd integers. \\
    Let $ \mathbb E $ denote the set of even integers. \\
    We can express this in the notation of symbolic logic as:
    $$\forall n \in \Z, [(n^2-2n+7) \in \mathbb E \implies n \in \mathbb O] $$ \\
    {\bf Proof:} \\
    \begin{pindent}
            Let $ \mathbb O $ denote the set of odd integers. \\
            Let $ \mathbb E $ denote the set of even integers. \\
            \begin{assumption}{$(n^2-2n+7) \in \mathbb E$}
                Then $n^2-2n+7=2q$, for some$\ q \in \Z$ \just{Definition of an even integer.}\\ 
                \begin{assumption}{$n \in \mathbb O$.}
                    Let $n=2p + 1$, for some $\ p \in \Z$ \just{Definition of odd integer.}\\ 
                    Then $(2p+1)^2-2(2p+1)+7=2q $ \just{Substitution}\\                    Then $4p^2+4p+1-4p-2+7=2q$ \\
                    Then $4p^2+6=2q$ \\
                    Then $2(2p^2+3)=2q$ \\
                    Then $2p^2+3=q$  \\
    				Then $2(p^2+1)+1=q$  \\
    				Let r=$p^2+1,$ for some $\ r \in \Z $  \just{Closure,\ p is an integer, so is $p^2+1.$}\\
    				Then $2r+1$ is odd \just{Definition of an odd integer}\\
    				Then $2r+1=q$\\
    			Then $(n^2-2n+7) \in \mathbb E \implies n \in \mathbb O$ \just{We assumed $(n^2-2n+7) \in \mathbb E$ and derived $n \in \mathbb O$} 
                \end{assumption}
            \end{assumption}{Therefore $\forall n \in \Z, [(n^2-2n+7) \in \mathbb E \implies n \in \mathbb O] $}
        \end{pindent}
        \medskip

    % place solution to question 3 below

    \item
    Consider the following claim:
    \begin{quote}
    For every real number $x$, if $|x-2|>2$ then $x^2>4x.$\
    \end{quote}
	We can express this in the notation of symbolic logic as:\\
	$$\forall x \in \R, (|x-2|>2) \implies (x^2>4x)  $$ 
	
    {\bf Proof:} \\
        \begin{pindent}
                \begin{assumption}{$|x-2|>2$}
                    Then $x-2>2$ or $-x+2>2$ \just{Definition of absolute value.}\\
                    Then $x>4$ or $x<0$\\ 
                    \begin{assumption}{$x^2>4x$.}
                        Then $x^2-4x>0$ \\ 
                        Then $x(x-4)>0 $ \just{Factoring.}\\
                        Then $[(x-4)>0) \land (x>0)] \lor [((x-4)<0) \land (x<0)] $ \just{Definition of inequality.}\\
                        Then $[(x>4) \land (x>0)] \lor [(x<4) \land (x<0)]$ \\
                        Then $[(x>4) \land (x>0)] \implies (x>4)$ \just{$x>4$ satifies both conditions.}\\
                        And $ [(x<4) \land (x<0)] \implies (x<0) $ \just{$x<0$ satifies both conditions.}\\ 
        				Then $ [(x>4) \lor (x<0)] \implies (x^2>4x) $ \\
        				Then $ [|x-2|>2] \implies [(x>4) \lor (x<0)]$\\
        				Then $ [|x-2|>2] \implies (x^2>4x) $ 
        				
                    \end{assumption}
                \end{assumption}{Therefore $\forall x \in \R, (|x-2|>2) \implies (x^2>4x)  $}
            \end{pindent}
            \medskip
	
    \item
    Consider the following claim:
    \begin{quote}
    There is no real number $x$ such that $x^4-4x^3+6x^2-4x+2=0$
    \end{quote}
     We can express this in the notation of symbolic logic as:
    $$ \forall x \in \R, x^4-4x^3+6x^2-4x+2\not=0$$\\
    
        {\bf Proof:} \\
            \begin{pindent}
                    \begin{assumption}{$ x^4-4x^3+6x^2-4x+2=0$}
                        Then $ x^4-4x^3+6x^2-4x+2=(x-1)^4+1$ \just{Factoring.}\\
            				Then $ (x-1)^4+1=0 $ \\
            				Then $(x-1)^4=-1$\\
            				Then $x-1=\sqrt[4]-1$ \just{An even root cannot be negative.}\\
            				We reach a contradiction.\\
            				And $x^4-4x^3+6x^2-4x+2=0$ is false.\\
            				Thus, our original implication is true.
                    \end{assumption}{Therefore $ \forall x \in \R, x^4-4x^3+6x^2-4x+2\not=0$}
                \end{pindent}
                \medskip


\end{enumerate}

\noindent
\rule{\textwidth}{.5pt}

\end{document}
